home *** CD-ROM | disk | FTP | other *** search
/ New Masters of Flash / New Masters of Flash.iso / pc / MOVIES / 15.dir / 00108_Text_text06.txt < prev    next >
Text File  |  2000-10-01  |  1KB  |  12 lines

  1. This variable will give us the current number of menu items on the stage. It will start out having a value of 1 and every time a new clip is duplicated (which happens in the next piece of script), it will increase by one. Once CurrentClip reaches 10, the script will shut off.
  2. This is the script that increments CurrentClip
  3.         
  4. if (/:CurrentClip) < 10 {
  5.   duplicateMovieClip  ("/" add /:CurrentClip, (/:CurrentClip)+1, Number(/:CurrentClip)+1;
  6.   /:CurrentClip = (/:CurrentClip)+1;
  7. } else{
  8.   stop ();
  9. }
  10.  
  11. The script will use this variable CurrentClip to get all of its information for the duplicating menu items. The new name of the duplications will be CurrentClip+1, so should there be only one menu item on the screen, the name of the new duplicate would be 2. If there were two menu items on the screen, the duplicate would be named 3. CurrentClip will also specify which depth the newly duplicated menu item should occupy. So if there is one menu item on the screen the new duplicate will occupy the depth 2. If there are two menu items the new duplicate will occupy depth 3.
  12. Now we have an auto-building menu, spawning itself from one movie clip and one script. At this point, all of the menu items will be duplicating into the same physical position on the screen and sitting directly on top of each other. WeΓÇÖll make a small alteration to the action on the first frame of the movie clip Menu Item to correct this overlap problem, so that the duplicated menu items will cascade.